
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
    Object.prototype.bar=1;
    var foo={
        moo:2
    };
    for(var i in foo){
        console.log(i); //moo  bar
    }
    // 这个题考察的是for  in 循环，for in 循环的是key值，它不仅会循环自身的属性，也会循环原型上的属性，所以最后打印moo和bar
    </script>
</body>
</html>